using Game.Core;
using UnityEngine;

namespace Game.Manager
{
	public class EffectManager : Singleton<EffectManager>
	{
		public Transform ShowEffect(string path, Vector3 pos, float lifeTime)
		{
			return StartEffect(path, pos, lifeTime);
		}

		private Transform StartEffect(string path, Vector3 pos, float lifeTime)
		{
			Transform transform = Singleton<GamePoolManager>.Instance.Spawn(path);
			if (transform != null)
			{
				transform.position = pos;
				transform.localScale = Vector3.one;
				Singleton<GamePoolManager>.Instance.Despawn(transform, lifeTime);
			}
			return transform;
		}
	}
}
